// 路由配置文件（router.js）

import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/login/index.vue"),
  },
  {
    path: "/",
    name: "Layout",
    component: () => import("../layout/index.vue"),
    // 嵌套路由
    children: [
      {
        // 这里不设置值，是把main作为默认页面
        path: "/",
        redirect: "/welcome",
      },
      {
        path: "/welcome",
        name: "Welcome",
        mate: {
          title: "首页",
          index: "/welcome",
          icon: "bytesize:home",
        },
        component: () => import("../views/welcome/index.vue"),
      },
      {
        path: "/teacher",
        name: "Teacher",
        mate: {
          title: "教师列表",
          index: "/teacher",
          icon: "bytesize:user",
          parent: "人员管理",
        },
        component: () => import("../views/people/teacher/index.vue"),
      },
      {
        path: "/student",
        name: "Student",
        mate: {
          title: "学生列表",
          index: "/student",
          parent: "人员管理",
        },
        component: () => import("../views/people/student/index.vue"),
      },
      {
        path: "/team",
        name: "Team",
        mate: {
          title: "基础信息",
          index: "/team",
          icon: "bytesize:flag",
          parent: "运动队管理",
        },
        component: () => import("../views/teams/team/index.vue"),
      },
      {
        path: "/members",
        name: "Members",
        mate: {
          title: "人员建设",
          index: "/members",
          parent: "运动队管理",
        },
        component: () => import("../views/teams/members/index.vue"),
      },
      {
        path: "/plans",
        name: "Plans",
        mate: {
          title: "训练计划",
          index: "/plans",
          icon: "bytesize:edit",
          parent: "训练管理",
        },
        component: () => import("../views/train/plans/index.vue"),
      },
      {
        path: "/localtion",
        name: "Localtion",
        mate: {
          title: "训练地点",
          index: "/localtion",
          parent: "训练管理",
        },
        component: () => import("../views/train/localtion/index.vue"),
      },
      {
        path: "/record",
        name: "Record",
        mate: {
          title: "考勤统计",
          index: "/record",
          icon: "bytesize:clipboard",
          parent: "考勤管理",
        },
        component: () => import("../views/kaoqin/record/index.vue"),
      },
      {
        path: "/leave",
        name: "Leave",
        mate: {
          title: "请假管理",
          index: "/leave",
          parent: "考勤管理",
        },
        component: () => import("../views/kaoqin/leave/index.vue"),
      },
      {
        path: "/awards",
        name: "Awards",
        mate: {
          title: "奖项列表",
          index: "/awards",
          icon: "healthicons:award-trophy-outline",
          parent: "荣誉管理",
        },
        component: () => import("../views/honor/awards/index.vue"),
      },
      // {
      //   path: "/picture",
      //   name: "Picture",
      //   mate: {
      //     title: "图片",
      //     index: "/picture",
      //     parent: "媒资管理",
      //   },
      //   component: () => import("../views/mediaCapital/picture/index.vue"),
      // },
      {
        path: "/banner",
        name: "Banner",
        mate: {
          title: "小程序轮播图列表",
          index: "/banner",
          icon: "bytesize:folder",
          parent: "媒资管理",
        },
        component: () => import("../views/mediaCapital/banner/index.vue"),
      },
      // {
      //   path: "/test",
      //   name: "Test",
      //   mate: {
      //     title: "测试",
      //     index: "/test",
      //   },
      //   component: () => import("../views/test/index.vue"),
      // },
    ],
  },
  {
    path: "/:pathMatch(.*)*",
    name: "NotFound",
    component: () => import("../views/error/404.vue"),
  },
  // 添加其他路由配置
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
